package com.wk.pms.controller;

import com.wk.common.bean.Resp;
import com.wk.pms.entity.SpuInfoDesc;
import com.wk.pms.service.SpuInfoDescService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/spuinfodesc")
public class SpuInfoDescController {

    @Autowired
    private SpuInfoDescService spuInfoDescService;

    @GetMapping("/info/{spuId}")
    public Resp<SpuInfoDesc> info(@PathVariable("spuId") Long spuId){
        SpuInfoDesc spuInfoDesc = spuInfoDescService.getById(spuId);

        return Resp.ok(spuInfoDesc);
    }
}

